{layout name="layout" /}
<div id="actionbar">
    <div class="fn-right">
        <form id="form" action="{:url('user/index')}" method="get">
            <input placeholder="请输入用户完整手机号" class="input w200" type="text" name="keyword" value="{$keyword}" /><input type="submit" value="搜索" class="button button-blue" />
        </form>
    </div>
    <div class="fn-left">
        <a href="{:url('user/index',['types'=>0])}" class="button{if $types == 0} button-green{/if}">正常</a>
        <a href="{:url('user/index',['types'=>1])}" class="button{if $types == 1} button-green{/if}">锁定</a>
    </div>
</div>
<table class="table">
    <thead>
        <tr>
            <th class="w260 fn-tac">操作</th>
            <th class="w100">手机号</th>
            <th class="w60 fn-tac">昵称</th>
            <th></th>
            <th class="w140">登录IP</th>
            <th class="w140">登录时间</th>
            <th class="w140">创建时间</th>
            <th class="w70 fn-tac">状态</th>
        </tr>
    </thead>
    <tbody>
        {foreach $list as $vo}
        <tr>
            <td>
                <a class="button" href="{:url('user/edit',array('id'=>$vo.id))}" title="编辑"><i class="iconfont icon-edit"></i>编辑</a>
                <a class="button isLock" url="{:url('user/islock',array('id'=>$vo.id))}" href="javascript:;" title="锁定/解锁">{if $vo.is_lock}<i class="iconfont icon-jiesuo"></i>解锁{else}<i class="iconfont icon-password_icon"></i>锁定{/if}</a>
            </td>
            <td>{$vo.phone_uid}</td>
            <td><img src="{$vo['face']}" class="w40" /></td>
            <td>{$vo.nickname}</td>
            <td>{$vo.login_ip}</td>
            <td>{$vo->login_time|date='Y-m-d H:i'}</td>
            <td>{$vo->create_time|date='Y-m-d H:i'}</td>
            <td class="fn-tac li">{if $vo.is_lock}<span class="badge bg-red">锁定</span>{else}<span class="badge">正常</span>{/if}</td>
        </tr>
        {/foreach}
    </tbody>
</table>
<div class="page">{$list|raw}</div>
<script type="text/javascript">
    Do('base', 'layer', function () {
        $('.isDel').isDel();
        $('.isLock').click(function () {
            var url = $(this).attr("url");
            parent.layer.confirm('确认要锁定当前用户?',{ icon: 3,title: '友情提示' }, function (index) {
                $.getJSON(url, function (data) {window.location.reload();});
                parent.layer.close(index);
            });
        })
    })
</script>